package com.feidee.fd.sml.algorithm

import com.feidee.fd.sml.algorithm.component.{BulkForecast, BulkForecastParam}
import com.feidee.fd.sml.algorithm.util.ToolClass
import org.scalatest.FunSuite

/**
  * @Author songhaicheng
  * @Date 2018/10/22 10:42
  * @Description
  * @Reviewer
  */
class BulkForecastSuite extends FunSuite {

  val bulk = new BulkForecast
  val paramStr: String =
    """
      |{
      |	"hive_table": "test.bulk_forecast",
      |	"modelPaths": ["/a/b/c","/d/e/f"]
      |}
    """.stripMargin
  val param: BulkForecastParam = bulk.parseParam(new ToolClass().encrypt(paramStr))

  test("BulkForecast parameter construction test") {
    assert(param.input_pt == null & param.output_pt == null &
      "test.bulk_forecast".equals(param.hive_table) &
      param.modelPaths.sameElements(Array[String]("/a/b/c", "/d/e/f")) &
      param.topn == 0)
  }

}
